package com.lovo.remoteservice;

import com.lovo.vo.TopUpVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * @author WXL
 * @date 2022/7/12
 */
@FeignClient(name = "pay")
public interface IPayService {
    @GetMapping("pay/consume/{userCode}/{consumeMoney}/{goodsInfo}")
    public boolean consumption(@PathVariable("userCode") String userCode,
                               @PathVariable("consumeMoney") float consumeMoney,
                               @PathVariable("goodsInfo") String goodsInfo);


    @GetMapping("pay/consumeConfirm/{userCode}")
    public Object consumeConfirm(@PathVariable("userCode")String userCode);

    @ApiOperation(value = "根据用户编号和充值金额生成token")
    @GetMapping("pay/tokenInfo/{userCode}/{money}")
    public String tokenInfo(@PathVariable("userCode") String userCode,
                            @PathVariable("money") double money);

    @ApiOperation(value = "充值，传入充值token,key=pay")
    @PostMapping("pay/TopUp")
    public TopUpVO TopUp(HttpServletRequest request);
}
